﻿#region

using Vin.Extension.Framework.Aop;
using Vin.Extension.Framework.Dto;
using Vin.Tool.Attributes;

#endregion

namespace Vin.Extension.Framework.Interface;

[IgnoreService]
public interface IVinFrameworkBaseServiceAsync<TEntityDto, in TEntityListDto>
    where TEntityDto : VinFrameworkBaseEntityDto
    where TEntityListDto : VinFrameworkBaseListDto
{
    Task<List<TEntityDto>> ListAsync(TEntityListDto dto);

    Task<List<TEntityDto>> ListAllAsync(TEntityListDto? dto = null, bool checkEnabled = true);

    Task<TEntityDto?> QueryAsync(long id);

    Task<List<TEntityDto>> QueryByIdsAsync(List<long> ids);

    [VinFrameworkTransaction]
    Task<TEntityDto?> SaveReturnDataAsync(TEntityDto dto);

    [VinFrameworkTransaction]
    Task<bool> SaveAsync(TEntityDto dto);

    [VinFrameworkTransaction]
    Task<bool> DelAsync(long id);

    [VinFrameworkTransaction]
    Task<bool> EnabledAsync(long id, bool? enabled);
    
    [VinFrameworkTransaction]
    Task<bool> EnabledAsync(long id);
}